const dealScan = async (message)=>{
    let eventId = message.EventKey[0].split("-");
    switch(eventId[0]){
        case "login":
            fun.event.emit(message.EventKey[0], {openId:message.FromUserName[0]});
            break;
        default:
    }
    return null;
};
const dealEvent = async (message)=>{
    switch(message.Event[0]){
        case "subscribe":
            if(message.EventKey[0]) fun.event.emit(message.EventKey[0].replace("qrscene_", ""), {openId:message.FromUserName[0]});
            break;
        case "unsubscribe":
            break;
        case "SCAN":
            return await dealScan(message);
            break;
        case "LOCATION":
            break;
        case "CLICK":
            break;
        case "VIEW":
            break;
    }
};
exports.dealMessage = async (message) => {
    let body = null;
    switch(message.MsgType[0]){
        case "event":
            body = await dealEvent(message);
            break;
        case "text":
            break;
        case "image":
            break;
        case "voice":
            break;
        case "video":
            break;
        case "shortvideo":
            break;
        case "location":
            break;
        case "link":
            break;
    }
    return body;
};